//
//  UIBarButtonItem-Extension.swift
//  ZHFWB
//
//  Created by 张海峰 on 2017/2/27.
//  Copyright © 2017年 张海峰. All rights reserved.
//

import UIKit
extension UIBarButtonItem
{
    convenience init(imageName: String) {
      //  self.init()
        //1.设置左侧的Item
        let btn = UIButton()
        btn.setImage(UIImage.init(named: imageName), for: .normal)
        btn.setImage(UIImage.init(named: imageName + "_highlighted"), for: .highlighted)
        btn.setImage(UIImage.init(named: imageName + "_highlighted"), for: .selected)
        btn.sizeToFit()
       // self.customView = btn
        self.init(customView: btn)
        
    }
}
